<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="../../common/taglibs.jsp"%>
<html:html>
<head>
	<%
		request.setCharacterEncoding("UTF-8");
	%>

	<base href="<%=basePath%>">
	<link rel="stylesheet" href="css/css.css" type="text/css"></link>
	<link rel="stylesheet" href="css/jquery.datepick.css" type="text/css"></link>
	<style type="text/css">
#leftSide {
	float: left;
	height: auto;
	width: 50%;
}

#rightSide {
	float: left;
	height: auto;
	width: 50%;
}
</style>
	<script type="text/javascript" src="js/global.js"></script>
	<script type="text/javascript" src="js/calendar.js"></script>
	<script type="text/javascript" src="js/jquery/jquery-1.7.2.js"></script>
	<script type="text/javaScript" src="js/jquery/jquery.datepick.js"></script>
	<script type="text/javaScript" src="js/jquery/jquery.datepick.lang.js"></script>
	<script type="text/javaScript" src="js/jquery/jquery.datepick-zh-CN.js"></script>
	<script type="text/javascript" src="js/plan/plan.js"></script>
	<script type="text/javascript" >
		$(function() {
		    var deleteArray=new Array();
				$("#leftDelete").click(
				function() {
					$('#leftTable >tbody >tr .checkBox:checked').each(
						function(index) {
							deleteArray.push($.trim($(this).parent().find(".planId").val()));
						}
					);
					window.location.href="<%=basePath%>plan/PlanCreateAction.do?method=deletePlan&deleteArray="+deleteArray;
				}
			);
		});
	
	</script>
</head>
<body>
	<table width="100%" height="29" border="0" cellpadding="0"
		cellspacing="0">
		<tr>
			<td background="images/top-5.gif"
				style="font-size: 14px; font-weight: bold;" align="center">
				计划管理
			</td>
		</tr>
	</table>
	<table class="tab_back">
		<tr>
			<td>
				<table border=0 cellpadding=0 cellspacing=0 height=25>
					<tr align=middle>
						<td width=5>
							&nbsp;
						</td>
						<td class="tab_left">
							&nbsp;
						</td>

						<td class="tab_on" valign="bottom" nowrap="nowrap">
							计划信息
						</td>
						<td class="tab_right" valign="bottom">
							&nbsp;
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>

	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr class="toptr2">
			<td>
			
					<table width="100%" border=0 cellpadding=3 cellspacing=0
						class="msglistcntrl" id="msglistcntrl">
						<tr>
							<td width="5%" align="center" nowrap>
								<input type="button" value="" class="buttonAdd" id="pAdd">
							</td>
							<td width="5%" align="center" nowrap>
								<input type="button" value="" class="buttonDel" id="leftDelete">
							</td>
							<td width="10%" align="center" nowrap>
							   当前日期：${fiDate}
							</td>
							<td width="80%" align="center" nowrap>
							</td>
						</tr>
					</table>
			</td>
		</tr>
	</table>

	<div id="leftSide">
		<table id="leftTable" width="100%" border="1" cellspacing="1"
			cellpadding="0" bgcolor="#D4D0C8">
			<thead>
				<tr class="toptr">
					<td align="center" width="5%">
						<input id="checkall" type="checkbox" name="checkall" value="1"
							onClick="global.CheckAll()">
					</td>
					<td align="center" width="10%">
						startTime
					</td>
					<td align="center" width="10%">
						endTime
					</td>
					<td align="center" width="10%">
						account
					</td>
					<td align="center" width="20%">
						loop
					</td>
					<td align="center" width="45%">
						description
					</td>

				</tr>
			</thead>
			<tbody id="tbody">
				<logic:present name="planListForm" scope="request">
					<logic:iterate id="list" name="planListForm" property="list">
						<tr class="leftTr">
							<td align="center">
								<input id="C_ID" type="checkbox" name="C_ID" class="checkBox">
								<input id="" type="hidden" name="C_ID" class="planId"
									value="<bean:write name='list' property='planId' />">
							</td>
							<td>
								<bean:write name='list' property='startTimeString' />
							</td>
							<td>
								<bean:write name='list' property='endTimeString' />
							</td>
							<td>
								<bean:write name="list" property="account" />
							</td>
							<td>
								<bean:write name="list" property="loop" />
							</td>
							<td>
								<a><bean:write name="list" property="description" /> </a>
							</td>
						</tr>
					</logic:iterate>
				</logic:present>
			</tbody>
		</table>
	</div>
	<div id="rightSide" style="display: none">
		<form action="plan/PlanCreateAction.do?method=createPlan"
			method="post"  onsubmit="return submitForm();">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr height="30">
					<td width="50%" align="left" valign="top">
						id:
						<input style="display: none" type="text"  id="currentDate" name="currentDate" value="${fiDate}" >
					</td>
					<td width="0%">
						&nbsp;
					</td>
					<td width="50%">
						<input id="planId" type="text" name="planId" readonly="readonly">
						<input id="objectId" type="hidden" name="objectId" >
					</td>
					<td width="0">
						&nbsp;
					</td>
				</tr>
				<tr height="30">
					<td width="50%" align="left" valign="top">
						catagory:
					</td>
					<td width="0%">
						&nbsp;
					</td>
					<td width="50%">
						<select id="catagory" name="catagory" >
							<option>
								请选择
							</option>
						</select>
					</td>
					<td width="0">
						&nbsp;
					</td>
				</tr>
				<tr height="30">
					<td width="20%" align="left" valign="top">
						description:
					</td>
					<td width="0%">
						&nbsp;
					</td>
					<td width="50%">
						<input id="description" type="text" name="description"
							maxlength="">
					</td>
					<td width="0">
						&nbsp;
					</td>
				</tr>
				<tr height="30">
					<td width="20%" align="left" valign="top">
						date:
					</td>
					<td width="0%">
						&nbsp;
					</td>
					<td width="50%">
						<input id="date" type="text" name="date" class="myDate"  />
					</td>
					<td width="0">
						&nbsp;
					</td>
				</tr>
				<tr>
					<td width="5">
						<input id="newAdd" type="button" value="新增">
					</td>
					<td width="5">
						<input id="newDelete" type="button" value="删除">
					</td>
					<td width="0%">
						&nbsp;
					</td>
					<td width="0%">
						&nbsp;
					</td>

				</tr>

			</table>

			<table width="100%" border="1" cellspacing="0" id="detailList">
				<thead>
					<tr class="toptr">
						<td width="1%">
							<input type="checkbox">
						</td>
						<td width="3%">
							account
						</td>
						<td width="8%">
							name
						</td>
						<td width="5%">
							loop
						</td>
						<td width="6%">
							startDate
						</td>
						<td width="6%">
							endDate
						</td>
					</tr>
				</thead>
				<tbody>
				</tbody>
			</table>
			<input type="submit" name="btn1" value=""  id="buttonSave" class="buttonSave">
			<input type="button" name="btn1" value=""  id="buttonModify" class="buttonSave">
		</form>
	</div>
	<table id="tableTemplete" style="display: none">
		<tbody>
			<tr>
				<td>
					<input id="checkBox_pIndex" name="subList[pIndex].checkBox"
						value="" type="checkbox" class="checkbox" />
				</td>
				<td>
					<input id="account_pIndex" name="subList[pIndex].account" value=""
						style="width: 100%;" class="showModalDialog" />
				</td>
				<td>
					<input id="accountName" name="" align="left" class="accountName"
						style="width: 100%;" readonly="readonly" />
				</td>
				<td>
					<input id="loop_pIndex" name="subList[pIndex].loop"
						style="width: 100%;" class="loop" readonly="readonly" />
				</td>
				<td>
					<select id="startHour_pIndex" name="subList[pIndex].startHour"
						class="startHour">
						<option value="0">
							0
						</option>
						<option value="1">
							1
						</option>
						<option value="2">
							2
						</option>
						<option value="3">
							3
						</option>
						<option value="4">
							4
						</option>
						<option value="5">
							5
						</option>
						<option value="6">
							6
						</option>
						<option value="7">
							7
						</option>
						<option value="8" selected="selected">
							8
						</option>
						<option value="9">
							9
						</option>
						<option value="10">
							10
						</option>
						<option value="11">
							11
						</option>
						<option value="12">
							12
						</option>
						<option value="13">
							13
						</option>
						<option value="14">
							14
						</option>
						<option value="15">
							15
						</option>
						<option value="16">
							16
						</option>
						<option value="17">
							17
						</option>
						<option value="18">
							18
						</option>
						<option value="19">
							19
						</option>
						<option value="20">
							20
						</option>
						<option value="21">
							21
						</option>
						<option value="22">
							22
						</option>
						<option value="23">
							23
						</option>
					</select>
					:
					<select id="startMinute_pIndex" name="subList[pIndex].startMinute"
						class="startMinute">
						<option value="00">
							0
						</option>
						<option value="30">
							30
						</option>
					</select>
				</td>
				<td>
					<select id="endHour_pIndex" name="subList[pIndex].endHour"
						class="endHour">
						<option value="0">
							0
						</option>
						<option value="1">
							1
						</option>
						<option value="2">
							2
						</option>
						<option value="3">
							3
						</option>
						<option value="4">
							4
						</option>
						<option value="5">
							5
						</option>
						<option value="6">
							6
						</option>
						<option value="7">
							7
						</option>
						<option value="8">
							8
						</option>
						<option value="9">
							9
						</option>
						<option value="10">
							10
						</option>
						<option value="11">
							11
						</option>
						<option value="12">
							12
						</option>
						<option value="13">
							13
						</option>
						<option value="14">
							14
						</option>
						<option value="15">
							15
						</option>
						<option value="16">
							16
						</option>
						<option value="17">
							17
						</option>
						<option value="18" selected="selected">
							18
						</option>
						<option value="19">
							19
						</option>
						<option value="20">
							20
						</option>
						<option value="21">
							21
						</option>
						<option value="22">
							22
						</option>
						<option value="23">
							23
						</option>
					</select>
					:
					<select id="endMinute_pIndex" name="subList[pIndex].endMinute"
						class="endMinute">
						<option value="00">
							0
						</option>
						<option value="30">
							30
						</option>
					</select>
				</td>
			</tr>
		</tbody>
	</table>
</body>
</html:html>
